package regex;

public class RegexTest {
	public static void main(String[] args) {
		System.out.println("1>>>"+regexNumber("N/A"));//F
		System.out.println("2>>>"+regexNumber("  "));//F
		System.out.println("3>>>"+regexNumber(""));//F
		System.out.println("4>>>"+regexNumber("0.0.0"));//F
		System.out.println("5>>>"+regexNumber("-001"));
		System.out.println("6>>>"+regexNumber("-00-1"));//F
		System.out.println("7>>>"+regexNumber("-0-0-1"));//F
		System.out.println("8>>>"+regexNumber("-0.1"));
		System.out.println("9>>>"+regexNumber(" -0.1 "));
		System.out.println("10>>>"+regexNumber(" 10/9 "));//F
		System.out.println("11>>>"+regexNumber(" 10\\9 ")); //F
		
	}
	
	public static boolean regexNumber(String src) {
		return src.trim().matches("^[\\+\\-]?[\\d]+(\\.[\\d]+)?");
	}
}
